<?php
/**
 * 视频API
 * @author Hongwei 2017-06-27
 */

namespace Videos\Controller;
use Common\Controller\FrontbaseController;
use Common\Controller\SmsbaseController;

class ApiController extends SmsbaseController{

	protected $videos_model;

	public function _initialize()
	{
		parent::_initialize();
		$this->videos_model = D('Videos/Videos');
	}

	/**
	 * 获取视频的列表
	 */
	public function videos_list(){
		$start = I('start');		//开始位置
		$limit = I('limit');		//显示数量

		$list = $this->videos_model->limit($start,$limit)->order('orderby desc')->select();

		// 判断返回结果
		if ($list) {
			$arr['status'] = '1';
			$arr['msg'] = '获取视频列表 成功！';
			$arr['info'] = $list;
		} else {
			$arr['status'] = '0';
			$arr['msg'] = '获取视频列表 失败！';
		}
		$this->output($arr);
	}
}